import { lazy } from "react";
import {
  BankcardOutline,
  SearchOutline,
  HeartOutline,
  ContentOutline,
  UserCircleOutline
} from 'antd-mobile-icons'

const Index = lazy(() => import('../pages/index'))
const Search = lazy(() => import('../pages/search'))
const Look = lazy(() => import('../pages/look'))
const Fuwu = lazy(() => import('../pages/fuwu'))
const My = lazy(() => import('../pages/my'))
const Home = lazy(() => import('../pages/home'))
const Login = lazy(() => import('../pages/login'))
const Register = lazy(() => import('../pages/register'))
const List = lazy(() => import('../pages/list'))
const Detail = lazy(() => import('../pages/detail'))
const Tick = lazy(() => import('../pages/tick'))
const Pay = lazy(() => import('../pages/pay'))
const Message = lazy(() => import('../pages/message'))
const Liaotian = lazy(() => import('../pages/liaotian'))
const Success = lazy(() => import('../pages/success'))

export const homeRouters = [
  {
    path: '/',
    element: <Index></Index>,
    title: '首页',
    icon: <BankcardOutline />
  },
  {
    path: '/search',
    element: <Search></Search>,
    title: '搜索',
    icon: <SearchOutline />
  },
  {
    path: '/look',
    element: <Look></Look>,
    title: '关注',
    icon: <HeartOutline />
  },
  {
    path: '/fuwu',
    element: <Fuwu></Fuwu>,
    title: '服务',
    icon: <ContentOutline />
  },
  {
    path: '/my',
    element: <My></My>,
    title: '我的',
    icon: <UserCircleOutline />
  },
]

export const routers = [
  {
    path: '/',
    element: <Home></Home>,
    children: homeRouters
  },
  {
    path: '/login',
    element: <Login></Login>
  },
  {
    path: '/register',
    element: <Register></Register>
  },
  {
    path: '/list',
    element: <List></List>
  },
  {
    path: '/detail/:id',
    element: <Detail></Detail>
  },
  {
    path: '/tick',
    element: <Tick></Tick>
  },
  {
    path: '/pay',
    element: <Pay></Pay>
  },
  {
    path: '/message',
    element: <Message></Message>
  },
  {
    path: '/liaotian',
    element: <Liaotian></Liaotian>
  },
  {
    path: '/success',
    element: <Success></Success>
  },
]